package br.com.playonline.action;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.playonline.bean.Bolao;
import br.com.playonline.enums.TipoDeJogo;
import br.com.playonline.negocio.BolaoBU;

@RequestScoped
@ManagedBean
public class IndexAction {

	private BolaoBU bolaoBU = new BolaoBU();
	private List<Bolao> bolaos;

	private List<Bolao> megaSena;
	private List<Bolao> quina;
	private List<Bolao> duplaSena;

	public IndexAction() {
		this.bolaos = this.bolaoBU.getAll(null);
		this.megaSena = this.bolaoBU.getAll(TipoDeJogo.MEGA_SENA);
		this.quina = this.bolaoBU.getAll(TipoDeJogo.QUINA);
		this.duplaSena = this.bolaoBU.getAll(TipoDeJogo.DUPLA_SENA);
	}

	public List<Bolao> getBolaos() {
		return bolaos;
	}

	public void setBolaos(List<Bolao> bolaos) {
		this.bolaos = bolaos;
	}

	public List<Bolao> getMegaSena() {
		return megaSena;
	}

	public void setMegaSena(List<Bolao> megaSena) {
		this.megaSena = megaSena;
	}

	public List<Bolao> getQuina() {
		return quina;
	}

	public void setQuina(List<Bolao> quina) {
		this.quina = quina;
	}

	public List<Bolao> getDuplaSena() {
		return duplaSena;
	}

	public void setDuplaSena(List<Bolao> duplaSena) {
		this.duplaSena = duplaSena;
	}

	public Integer getSizeMegaSena() {
		return this.megaSena != null ? this.megaSena.size() : 0;
	}

	public Integer getSizeQuina() {
		return this.quina != null ? this.quina.size() : 0;
	}

	public Integer getSizeDuplaSena() {
		return this.duplaSena != null ? this.duplaSena.size() : 0;
	}

}
